package com.data.center.mapper;

import com.data.center.entity.Dictionary.SpecializedTechnicalJob;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

import static org.junit.Assert.*;

@RunWith(SpringRunner.class)
@SpringBootTest
public class SpecializedTechnicalJobMapperTestSC {

    @Autowired
    private SpecializedTechnicalJobMapper mapper;

    @Test
    public void testGetByCode() {
        SpecializedTechnicalJob job = mapper.getByCode("010");
        assertNotNull(job);
        assertEquals("高等学校教师", job.getName());
    }

    @Test
    public void testSearchByName() {
        List<SpecializedTechnicalJob> list = mapper.searchByName("%教师%");

        assertTrue(list.size() > 0);
        assertTrue(list.get(0).getName().contains("教师"));
    }

}